<template>
  <div class="container">
    <img class="img-content" :src="url" alt="">
    <noticeBar></noticeBar>
    <productForm :productId="id" :belongId="belongId"></productForm>
  </div>
</template>

<script>
import productForm from '@/components/product-form';
import noticeBar from '@/components/notice-bar';
import wxShare from "@/utils/share";
export default {
  name: "product-img",
  components: {productForm,noticeBar},
  data() {
    return {
      id: '',
      url: '',
      belongId:'',
    }
  },
  mounted() {
    this.id=this.$route.query.productId;
    this.belongId=this.$route.query.scene;
    if(this.id){
      this.getProductImg();
    }

  },
  methods: {
    getProductImg() {
      this.$axios.get(`/html/apply/getH5LandPage/${this.id}`).then(res => {
        this.url = res.data.data.tbProductImgList[0].ossUrl
        let title=res.data.data.shareTitle;
        let desc=res.data.data.shareDescribe;
        let imgUrl=res.data.data.shareSavePhoto;
        console.log(title,desc,imgUrl)
        wxShare(title,desc,imgUrl);
      })
    },
  },
}
</script>

<style scoped>
.container{
  position: relative;
}

.img-content {
  width: 100%;
  height: 100%;
  display: block;
}

</style>